package com.atguigu.mr.sort;

import com.atguigu.mr.flow.FlowBean;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @description: xxx
 * @time: 20191226 19:59
 * @author: baojinlong
 **/
public class FlowCountSortReducer  extends Reducer<FlowBean, Text, Text, FlowBean> {
    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        // 循环输出，避免总流量相同情况
        for (Text value : values) {
            context.write(value, key);
        }
    }
}
